package org.jeecg.modules.friends.base;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.reflect.MethodSignature;

/**
 * Created on 2022-09-22
 */
public abstract class BaseAspect {
    /**
     * 获取方法的全名
     *
     * @return 例如:
     * com.bjcoder.example.biz.aspects.LogAspect.getMethodQualifiedName
     */
    protected String getMethodQualifiedName(ProceedingJoinPoint jp) {
        MethodSignature signature = (MethodSignature) jp.getSignature();
        StringBuilder sb = new StringBuilder();
        sb.append(signature.getDeclaringTypeName());
        sb.append(".");
        sb.append(signature.getMethod().getName());
        return sb.toString();
    }
}
